package com.encryption.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * User entity. @author MyEclipse Persistence Tools
 */

public class User implements java.io.Serializable {

	// Fields

	private Integer id;
	private int role;
	private int department;
	private String loginName;
	private String password;
	private String realName;
	private String mobile;
	private String email;
	private String post;
	private Integer aduitState;
	private Date registerTime;
	private Date lastLogin;
	private int fileLevel = 0;

	private boolean applyCert;

	// Constructors

	/** default constructor */
	public User() {
	}

	public User(Integer id, int role, int department, String loginName,
			String password, String realName, String mobile, String email,
			String post, Integer aduitState, Date registerTime, Date lastLogin,
			int fileLevel, boolean applyCert) {
		super();
		this.id = id;
		this.role = role;
		this.department = department;
		this.loginName = loginName;
		this.password = password;
		this.realName = realName;
		this.mobile = mobile;
		this.email = email;
		this.post = post;
		this.aduitState = aduitState;
		this.registerTime = registerTime;
		this.lastLogin = lastLogin;
		this.fileLevel = fileLevel;
		this.applyCert = applyCert;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public int getRole() {
		return role;
	}

	public void setRole(int role) {
		this.role = role;
	}

	public int getDepartment() {
		return department;
	}

	public void setDepartment(int department) {
		this.department = department;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public Integer getAduitState() {
		return aduitState;
	}

	public void setAduitState(Integer aduitState) {
		this.aduitState = aduitState;
	}

	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	public Date getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(Date lastLogin) {
		this.lastLogin = lastLogin;
	}

	public boolean isApplyCert() {
		return applyCert;
	}

	public void setApplyCert(boolean applyCert) {
		this.applyCert = applyCert;
	}

	public int getFileLevel() {
		return fileLevel;
	}

	public void setFileLevel(int fileLevel) {
		this.fileLevel = fileLevel;
	}

	public String toString() {
		return realName + "(" + loginName + ")";
	}

	public User cloneItem() {
		User user = new User(id, role, department, loginName, password,
				realName, mobile, email, post, aduitState, registerTime,
				lastLogin, fileLevel, false);
		
		return user;
	}

}